package cn.itsource.pay.controller;


import cn.itsource.basic.util.AjaxResult;
import cn.itsource.pay.domain.dto.PayDto;
import cn.itsource.pay.service.IOrderAdoptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/adoptOrder")
@Slf4j
public class OrderAdoptController {
    @Autowired
    private IOrderAdoptService orderAdoptService;

    /**
     * 提交订单 接受addressId 和petId
     * @return
     */
    @RequestMapping("/submitOrder")
    public AjaxResult submitOrder(@RequestBody PayDto payDto){

        //提交订单
        String formData = orderAdoptService.submitOrder(payDto);

        return AjaxResult.createSuccess(formData);
    }




}
